﻿@namespace MudBlazor
@inherits MudComponentBase
@typeparam T

<TemplateColumn T="T" Tag="@("hierarchy-column")" Sortable="false" Resizable="false" ShowColumnOptions="false" HeaderClassFunc="@HeaderClassFunc"
    Hideable="Hideable" Hidden="Hidden" HiddenChanged="HiddenChanged" HeaderClass="@(EnableHeaderToggle ? $"mud-header-togglehierarchy {HeaderClass}" : HeaderClass)"
    Filterable="false" Editable="false" DragAndDropEnabled="@DragAndDropEnabled" HeaderTemplate="@HeaderTemplate" ButtonDisabledFunc="@ButtonDisabledFunc"
    HeaderStyle="@HeaderStyle" HeaderStyleFunc="@HeaderStyleFunc" InitiallyExpandedFunc="@InitiallyExpandedFunc">
    <CellTemplate>
        @if (CellTemplate is not null)
        {
            @CellTemplate(context)            
        }
        else
        {
            <MudIconButton 
                Class="ma-n3 pa-1"
                Icon="@GetGroupIcon(context)" 
                OnClick="context.Actions.ToggleHierarchyVisibilityForItemAsync"
                Size="@IconSize"
                Disabled="ButtonDisabledFunc.Invoke(context.Item)"/>
        }
    </CellTemplate>
</TemplateColumn>
